<?php
namespace plugins\pay\model;
use think\Model;

class PayLogModel extends Model
{
    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = false;
    
    public function getTypeTextAttr( $value , $data )
    {
        $arr = [ '正常' , '异常' , '错误' ];
        return $arr [ $value ] ;
    }
    
    //记录日志
    public static function W($type , $content , $remark = '' )
    {
        parent::create( [
            'type'      => $type,
            'content'   => $content,
            'remark'    => $remark
         ] );
    }
    
}